package com.holike.crm.presenter.fragment;

import com.holike.crm.base.BasePresenter;
import com.holike.crm.bean.BillListBean;
import com.holike.crm.http.RequestCallBack;
import com.holike.crm.model.fragment.BillListModel;
import com.holike.crm.view.fragment.BillView;

public class BillPresenter extends BasePresenter<BillView, BillListModel> {

    public void getHeadData(int pageNo, int pageSize, String startTime, String endTime) {
        if (getModel() != null)
            getModel().getData(String.valueOf(pageNo), String.valueOf(pageSize), startTime == null ? "" : startTime, endTime == null ? "" : endTime, new RequestCallBack<BillListBean>() {
                @Override
                public void onFailed(String failReason) {
                    if (getView() != null) {
                        getView().onFailure(failReason);
                    }
                }

                @Override
                public void onSuccess(BillListBean result) {
                    if (getView() != null) {
                        getView().onSuccess(result);
                    }
                }
            });
    }
}
